FAQ
F.A.Q.
Domande - Risposte
Abbreviare i record troppo lunghi - asp
Internet Provider
Software
Internet Provider
mail marketing
preventivi Internet
supporto tecnico
sms da web
download
corsi
lavoro
pagamenti
Internet Provider
 
FAQ
faq
news
Applicativi asp
Motomania

Abbreviare i record troppo lunghi - asp

<%@LANGUAGE = JScript%>
<%
   var Cn = new ActiveXObject("ADODB.Connection");
   Cn.Open("driver={Microsoft Access Driver (*.mdb)};dbq=" + Server.MapPath("database.mdb"));
  
   var Mostra = Cn.Execute("SELECT * FROM tabella");
   // Converto il record che mi interessa in stringa
   var Stringa = String(Mostra("descrizione"));

      // e ne calcolo la lunghezza che, se superiore a TOT  
   if (Stringa.length >= 30)
   {
       // creo una sottostringa ed aggiungo tre puntini...
       Response.Write(Stringa.substr(0,29) + "...");
   }
   else
   {
       // altrimenti lo stampo per intero omettendo i tre puntini!
       Response.Write(Stringa);
   }
  
   Cn.Close();
%>


faq Indietro

 

Home | Chi Siamo | Contatti | Internet Provider | Software House | Active Web | Web Marketing | SMS | Realizzazioni | Preventivi | Supporto | Lavoro | Condizioni
RD Informatica - Str. Rupola 14 - 61122 Pesaro PU - Tel 0721 206238 Fax 0721 1835042 P.Iva 01241970415 - info@rdinformatica.com 
Estrattore Pagine Gialle
Applicativi asp
RD
Applicativi asp
Internet provider
Software House
Applicativi asp
SMS Web
Software SMS
Mailing Project